package com.wcy.feign.resource;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wcy.entity.ResourceTag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name = "cloud-provider-resource",  contextId = "FeignResourceTagController")
public interface FeignResourceTagService {
    @GetMapping("resourceTag/page")
    public ResponseEntity<Page<ResourceTag>> getPage(@RequestParam(name = "pageNum",defaultValue = "1") int pageNum,
                                                     @RequestParam(name = "pageSize",defaultValue = "10") int pageSize) ;

    @GetMapping("resourceTag/list")
    public ResponseEntity<List<ResourceTag>> getList() ;

    @PostMapping("resourceTag/add")
    public ResponseEntity<Void> add(@RequestBody ResourceTag resourceTag) ;

    @PutMapping("resourceTag/update")
    public ResponseEntity<Void> update(@RequestBody ResourceTag resourceTag) ;

    @DeleteMapping("resourceTag/delete/{id}")
    public ResponseEntity<Void> delete(@PathVariable("id") Integer id);

    @GetMapping("resourceTag/getByResourceId/{id}")
    public ResponseEntity<List<ResourceTag>> getByResourceId(@PathVariable("id") Integer id);
}
